import {
  mapState,
  mapMutations
} from 'vuex';
import {
  NS,
  API
} from './constant';
const NS_HOME = NS.HOME;
const NS_SEARCH = NS.SEARCH;
const NS_PERSONAL = NS.PERSONAL;
const NS_PAGINATION = NS.PAGINATION;


export let home = {
  computed: {
    //是否首页index模块
    isNotIndexHomePage() {
      return this.$route.name !== NS_HOME;
    },
    ...mapState(NS_HOME, ['query'])
  } 
};

export let search = {
  computed: {
    ...mapState(NS_SEARCH, ['search'])
  }
}

export let pagination = {
  computed: {
    ...mapState(NS_PAGINATION, ['currentPage'])
  },
  methods: {
    ...mapMutations(NS_PAGINATION, {
      renderPagination: 'renderPagination'
    })
  }
};

export let personal = {
  computed: {
    isNotPersonalHomePage() {
      return this.$route.name !== NS_PERSONAL;
    }
  }
}
